package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.NiceDetail;
import cn.wolfcode.trip.base.mapper.NiceDetailMapper;
import cn.wolfcode.trip.base.service.INiceDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@Discription 创建点赞接口方法

 *@Params

 *@Return

 *@Authod  黄照伟

 *@CreationTime  2019/3/10 10:00

 *@change

 */
@Service
public class NiceDetailServiceImpl implements INiceDetailService {
    @Autowired
    private NiceDetailMapper niceDetailMapper;
    @Override
    public void insert(NiceDetail niceDetail) {
        niceDetailMapper.insert(niceDetail);
    }

    @Override
    public void delete(Long id) {
        niceDetailMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<NiceDetail> selectByUserIdAndContentId(Long userId, Long contentId) {
        return niceDetailMapper.selectByUserIdAndContentId(userId,contentId);
    }

    @Override
    public int getAssistCount(Long userId) {
        return niceDetailMapper.getAssistCountByUserId(userId);
    }
}
